package com.souku.finance.application.ui.invite;

import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.RelativeLayout;
import android.widget.TextView;

import com.souku.finance.application.R;
import com.souku.finance.application.base.BaseActivity;
import com.souku.finance.application.bean.PaySuccessBean;
import com.souku.finance.application.utils.Constant;

/**
 * Created by Android on 2017/1/18.
 */

public class PaySuccessActivity extends BaseActivity implements View.OnClickListener {

    protected Button btnOk;
    protected RelativeLayout topBack;
    protected TextView topTitle;
    protected TextView tvDealName;
    protected TextView tvMoney;
    protected TextView tvDate;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        super.setContentView(R.layout.act_paysuccess);
        initView();
        topTitle.setText("购买成功");
        PaySuccessBean bean=getIntent().getParcelableExtra(Constant.Default);
        setData(bean);
    }

    @Override
    public void internet() {

    }

    @Override
    public void onClick(View view) {
        if (view.getId() == R.id.btn_ok) {
            finish();
        } else if (view.getId() == R.id.top_back) {
            finish();
        }
    }

    private void setData(PaySuccessBean bean){
        tvMoney.setText("￥"+bean.getMoney());
        tvDealName.setText(bean.getDealName());
    }

    private void initView() {
        btnOk = (Button) findViewById(R.id.btn_ok);
        btnOk.setOnClickListener(PaySuccessActivity.this);
        topBack = (RelativeLayout) findViewById(R.id.top_back);
        topBack.setOnClickListener(PaySuccessActivity.this);
        topTitle = (TextView) findViewById(R.id.top_title);
        tvDealName = (TextView) findViewById(R.id.tv_dealName);
        tvMoney = (TextView) findViewById(R.id.tv_money);
        tvDate = (TextView) findViewById(R.id.tv_date);
    }
}
